/*******************************************************************************
 * Copyright (c) 2009 Kevin Bierhoff and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Kevin Bierhoff - initial API and implementation
 *******************************************************************************/
package com.googlecode.twelfdevtools.editor;

import org.eclipse.jface.text.rules.IWordDetector;

/**
 * Recognizes Twelf unification variables.
 * @author Kevin Bierhoff
 *
 */
public class TwelfVariableDetector implements IWordDetector {

	public boolean isWordPart(char c) {
		return ((c>'A') && (c<='z')) || ((c>='0') && (c<= '9')) || (c == '\'');
	}

	/**
	 * Unification variables start with a capital letter.
	 * @return <code>true</code> if <code>c</code> is a
	 * capital letter, <code>false</code> otherwise.
	 */
	public boolean isWordStart(char c) {
		return (c>'A') && (c<='Z');
	}

}
